package co.fitstart.signin.dao;

import java.util.Date;
import java.util.List;

import com.demo2do.core.persistence.annotation.Dao;
import com.demo2do.core.persistence.annotation.Query;
import com.demo2do.core.persistence.annotation.Variable;

import co.fitstart.entity.user.User;
import co.fitstart.entity.user.inbody.InbodyRecord;

/**
 * 
 * @author haiyan_xiao
 *
 */
@Dao("hibernate")
public interface InbodyRecordDao {

    /**
     * 
     * @param user
     * @param begin
     * @param end
     * @return
     */
    @Query("FROM InbodyRecord WHERE disabled = false AND user = :user AND STR_TO_DATE(LEFT(recordTime, 10),'%Y-%m-%d') BETWEEN :begin AND :end ORDER BY STR_TO_DATE(recordTime,'%Y-%m-%d %H:%i:%S') ASC")
    public List<InbodyRecord> listInbodyRecord(@Variable("user") User user, @Variable("begin") Date begin, @Variable("end") Date end);
}
